bazel_dep(name = "rules_java", version = "8.6.1")
bazel_dep(name = "rules_pkg", version = "1.1.0")
bazel_dep(name = "protobuf", version = "30.2")
bazel_dep(name = "bazel_jar_jar", version = "0.1.5")
bazel_dep(name = "google_bazel_common", version = "0.0.1")
git_override(
    module_name = "google_bazel_common",
    # Pin to newer version to fix b/408030907
    commit = "2cab52929507935aa43d460a3976d3bedc814d3a",
    remote = "https://github.com/google/bazel-common",
)
bazel_dep(name = "rules_jvm_external", version = "6.6")

## START_MAVEN_ARTIFACTS_LIST
# List of external dependencies from Maven. Also update corresponding POM file below.
MAVEN_ARTIFACTS = [
    "args4j:args4j:2.33",
    "com.google.code.gson:gson:2.9.1",
    "com.google.errorprone:error_prone_annotations:2.5.1",
    "com.google.guava:failureaccess:1.0.1",
    "com.google.guava:guava:33.4.6-jre",
    "com.google.guava:guava-testlib:33.4.6-jre",
    "com.google.jimfs:jimfs:1.2",
    "com.google.protobuf:protobuf-java:4.30.2",
    "com.google.re2j:re2j:1.8",
    "com.google.truth.extensions:truth-proto-extension:1.4.4",
    "io.github.java-diff-utils:java-diff-utils:4.12",
    "org.apache.ant:ant:1.10.11",
    "org.jspecify:jspecify:0.3.0",
]

# Pom and gradle files for Maven dependencies. Only used to automatically extract license
# information, not as part of the actual build.
#
# Note: if a pom/gradle file is not checked into GitHub, please add the artifact name and license
# url to ADDITIONAL_LICENSES below.
#
# After updating dependencies, please run the license check script from this directory:
#   ./license_check/third_party_license_test.sh --update
#
# Note the added "@" after version tag to make easier to extract the root url
ORDERED_POM_OR_GRADLE_FILE_LIST_FOR_LICENSE_CHECK = [
    "https://github.com/kohsuke/args4j/blob/args4j-site-2.33@/args4j/pom.xml",
    "https://github.com/google/gson/blob/gson-parent-2.9.1@/gson/pom.xml",
    "https://github.com/google/error-prone/blob/v2.5.1@/annotations/pom.xml",
    "https://github.com/google/guava/blob/failureaccess-v1.0.1@/futures/failureaccess/pom.xml",
    "https://github.com/google/guava/blob/v33.4.6@/guava/pom.xml",
    "https://github.com/google/guava/blob/v33.4.6@/guava-testlib/pom.xml",
    "https://github.com/google/jimfs/blob/v1.2@/jimfs/pom.xml",
    "https://github.com/google/re2j/blob/re2j-1.3@/build.gradle",
    "https://github.com/google/truth/blob/v1.4.4@/extensions/proto/pom.xml",
    "https://github.com/java-diff-utils/java-diff-utils/blob/java-diff-utils-parent-4.12@/java-diff-utils/pom.xml",
    "https://github.com/apache/ant/blob/rel/1.10.11@/src/etc/poms/ant/pom.xml",
    "https://github.com/jspecify/jspecify/blob/v0.3.0@/gradle/publish.gradle",
]

# Additional GitHub links to license files for maven artifacts. Add an entry here only if there is
# no pom or gradle file checked into GitHub. (The advantage of being able to use the pom/gradle file
# is that we don't have to hardcode the artifact id here and can just read it from the file).
# TODO: lharker - could we instead grab license information from the maven repository?
ADDITIONAL_LICENSES = {
    "com.google.protobuf:protobuf-java": "https://github.com/protocolbuffers/protobuf/blob/v4.30.1/LICENSE",
}

## END_MAVEN_ARTIFACTS_LIST

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
maven.install(
    artifacts = MAVEN_ARTIFACTS,
    repositories = [
        "https://maven.google.com",
        "https://repo1.maven.org/maven2",
    ],
)
use_repo(maven, "maven")

# Works around https://github.com/bazelbuild/rules_python/issues/1169
bazel_dep(name = "rules_python", version = "0.28.0")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
    ignore_root_user_error = True,
    python_version = "3.11",
)
